import { Directive, HostListener, Input, Output, EventEmitter } from '@angular/core';

@Directive({
  // tslint:disable-next-line:directive-selector
  selector: '[mousedownListener]'
})
export class MousedownListenerDirective {
  @Input()
  public isLeftkeyDown: boolean;
  @Output()
  public onLeftkeyup = new EventEmitter();
  @Output()
  public onLeftkeydown = new EventEmitter();
  // @Output()
  // public onMouseover = new EventEmitter();

  constructor() {
  }

  @HostListener('mousedown', ['$event'])
  leftkeydown(event: MouseEvent) {
    this.onLeftkeydown.emit('keydown');
  }

  @HostListener('mouseup', ['$event'])
  leftkeyup(event: MouseEvent) {
    console.log('ssss');
    this.onLeftkeyup.emit('keyup');
  }

  // @HostListener('mouseenter', ['$event'])
  // mouseover(event: MouseEvent) {
  //   this.onMouseover.emit('mouseover');
  // }
}
